package com.lg.partition20;

import java.io.*;
import java.util.Arrays;

/**
 * @author `RKC`
 * @date 2022/3/27 9:33
 */
public class P1991无线通讯网 {

    private static final int N = 510;
    private static int[] px = new int[N], py = new int[N], parent = new int[N];
    private static Edge[] edges = new Edge[N * N];
    private static int n, cnt = 0, s = 0;

    private static final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    private static final BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        String[] ss = reader.readLine().split(" ");
        s = Integer.parseInt(ss[0]);
        n = Integer.parseInt(ss[1]);
        for (int i = 1; i <= n; i++) {
            parent[i] = i;
            ss = reader.readLine().split(" ");
            int x = Integer.parseInt(ss[0]), y = Integer.parseInt(ss[1]);
            px[i] = x;
            py[i] = y;
        }
        for (int i = 1; i <= n; i++) {
            for (int j = i + 1; j <= n; j++) {
                edges[cnt++] = new Edge(i, j, cal(i, j));
            }
        }
        Arrays.sort(edges, 0, cnt);
        int k = 0;
        double ans = 0;
        for (int i = 0; i < cnt; i++) {
            int a = edges[i].u, b = edges[i].v;
            int pa = find(a), pb = find(b);
            if (pa != pb) {
                parent[pa] = pb;
                k++;
                ans = edges[i].dist;
            }
            if (k == n - s) break;
        }
        writer.write(String.format("%.2f\n", ans));
        writer.flush();
    }

    private static int find(int x) {
        if (x != parent[x]) parent[x] = find(parent[x]);
        return parent[x];
    }

    private static double cal(int u, int v) {
        int x1 = px[u], y1 = py[u], x2 = px[v], y2 = py[v];
        return Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
    }

    private static class Edge implements Comparable<Edge> {
        private int u, v;
        private double dist;

        public Edge(int u, int v, double dist) {
            this.u = u;
            this.v = v;
            this.dist = dist;
        }

        @Override
        public int compareTo(Edge o) {
            return Double.compare(dist, o.dist);
        }
    }
}
